home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
thinkref
/
archive
/
THINKPascalUH2.1.sea
/
THINKPas Univ Hdr 2.1
/
Interfaces
/
Terminals.p
< prev
next >
Wrap
Text File
|
1995-09-14
|
12KB
|
352 lines
{ Converted with MPW2TPas Tuesday, September 12, 1995 10:35:40 PM }
{}
{ File: Terminals.p}
{ }
{ Contains: Communications Toolbox Terminal tool Interfaces.}
{ }
{ Version: Technology: System 7.5}
{ Package: Universal Interfaces 2.1 in “MPW Latest” on ETO #18}
{ }
{ Copyright: © 1984-1995 by Apple Computer, Inc.}
{ All rights reserved.}
{ }
{ Bugs?: If you find a problem with this file, use the Apple Bug Reporter}
{ stack. Include the file and version information (from above)}
{ in the problem description and send to:}
{ Internet: apple.bugs@applelink.apple.com}
{ AppleLink: APPLE.BUGS}
{ }
{}
unit Terminals;
interface
{$IFC UNDEFINED __TERMINALS__}
{$SETC __TERMINALS__ := 1}
uses
ConditionalMacros, Types, Quickdraw, Dialogs, AppleTalk, CTBUtilities, Connections;
{ $PUSH}
{ $ALIGN MAC68K}
{ $LibExport+}
const
{ current Terminal Manager version }
curTMVersion = 2;
{ current Terminal Manager Environment Record version }
curTermEnvRecVers = 0;
{ error codes }
tmGenericError = -1;
tmNoErr = 0;
tmNotSent = 1;
tmEnvironsChanged = 2;
tmNotSupported = 7;
tmNoTools = 8;
type
TMErr = OSErr;
const
tmInvisible = $1;
tmSaveBeforeClear = $2;
tmNoMenus = $4;
tmAutoScroll = $8;
tmConfigChanged = $10;
type
TMFlags = LONGINT;
const
selTextNormal = $1;
selTextBoxed = $2;
selGraphicsMarquee = $4;
selGraphicsLasso = $8;
tmSearchNoDiacrit = $100;
tmSearchNoCase = $200;
type
TMSearchTypes = INTEGER;
TMSelTypes = INTEGER;
const
cursorText = 1;
cursorGraphics = 2;
type
TMCursorTypes = INTEGER;
const
tmTextTerminal = $1;
tmGraphicsTerminal = $2;
type
TMTermTypes = INTEGER;
TermDataBlock = record
flags: TMTermTypes;
theData: Handle;
auxData: Handle;
reserved: LONGINT;
end;
TermDataBlockPtr = ^TermDataBlock;
TermDataBlockH = ^TermDataBlockPtr;
TermDataBlockHandle = ^TermDataBlockPtr;
TermEnvironRec = record
version: INTEGER;
termType: TMTermTypes;
textRows: INTEGER;
textCols: INTEGER;
cellSize: Point;
graphicSize: Rect;
slop: Point;
auxSpace: Rect;
end;
TermEnvironPtr = ^TermEnvironRec;
TMSelection = record
case INTEGER of
0: (
selRect: Rect;
);
1: (
selRgnHandle: RgnHandle;
);
end;
TermPtr = ^TermRecord;
TermHandle = ^TermPtr;
TerminalSendProcPtr = ProcPtr; { FUNCTION TerminalSend(thePtr: Ptr; theSize: LONGINT; refCon: LONGINT; flags: CMFlags): LONGINT; }
TerminalBreakProcPtr = ProcPtr; { PROCEDURE TerminalBreak(duration: LONGINT; refCon: LONGINT); }
TerminalCacheProcPtr = ProcPtr; { FUNCTION TerminalCache(refCon: LONGINT; theTermData: TermDataBlockPtr): LONGINT; }
TerminalSearchCallBackProcPtr = ProcPtr; { PROCEDURE TerminalSearchCallBack(hTerm: TermHandle; refNum: INTEGER; VAR foundRect: Rect); }
TerminalClikLoopProcPtr = ProcPtr; { FUNCTION TerminalClikLoop(refCon: LONGINT): BOOLEAN; }
TerminalEnvironsProcPtr = ProcPtr; { FUNCTION TerminalEnvirons(refCon: LONGINT; VAR theEnvirons: TermEnvironRec): CMErr; }
TerminalChooseIdleProcPtr = ProcPtr; { PROCEDURE TerminalChooseIdle; }
TerminalToolDefProcPtr = ProcPtr; { FUNCTION TerminalToolDef(hTerm: TermHandle; msg: INTEGER; p1: LONGINT; p2: LONGINT; p3: LONGINT): LONGINT; }
TerminalSendUPP = UniversalProcPtr;
TerminalBreakUPP = UniversalProcPtr;
TerminalCacheUPP = UniversalProcPtr;
TerminalSearchCallBackUPP = UniversalProcPtr;
TerminalClikLoopUPP = UniversalProcPtr;
TerminalEnvironsUPP = UniversalProcPtr;
TerminalChooseIdleUPP = UniversalProcPtr;
TerminalToolDefUPP = UniversalProcPtr;
TermRecord = record
procID: INTEGER;
flags: TMFlags;
errCode: TMErr;
refCon: LONGINT;
userData: LONGINT;
defProc: TerminalToolDefUPP;
config: Ptr;
oldConfig: Ptr;
environsProc: TerminalEnvironsUPP;
reserved1: LONGINT;
reserved2: LONGINT;
tmPrivate: Ptr;
sendProc: TerminalSendUPP;
breakProc: TerminalBreakUPP;
cacheProc: TerminalCacheUPP;
clikLoop: TerminalClikLoopUPP;
owner: WindowPtr;
termRect: Rect;
viewRect: Rect;
visRect: Rect;
lastIdle: LONGINT;
selection: TMSelection;
selType: TMSelTypes;
mluField: LONGINT;
end;
const
uppTerminalSendProcInfo = $00002FF0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 2 byte param): 4 byte result; }
uppTerminalBreakProcInfo = $000003C0; { PROCEDURE (4 byte param, 4 byte param); }
uppTerminalCacheProcInfo = $000003F0; { FUNCTION (4 byte param, 4 byte param): 4 byte result; }
uppTerminalSearchCallBackProcInfo = $00000EC0; { PROCEDURE (4 byte param, 2 byte param, 4 byte param); }
uppTerminalClikLoopProcInfo = $000000D0; { FUNCTION (4 byte param): 1 byte result; }
uppTerminalEnvironsProcInfo = $000003E0; { FUNCTION (4 byte param, 4 byte param): 2 byte result; }
uppTerminalChooseIdleProcInfo = $00000000; { PROCEDURE ; }
uppTerminalToolDefProcInfo = $0000FEF0; { FUNCTION (4 byte param, 2 byte param, 4 byte param, 4 byte param, 4 byte param): 4 byte result; }
function NewTerminalSendProc (userRoutine: TerminalSendProcPtr): TerminalSendUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewTerminalBreakProc (userRoutine: TerminalBreakProcPtr): TerminalBreakUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewTerminalCacheProc (userRoutine: TerminalCacheProcPtr): TerminalCacheUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewTerminalSearchCallBackProc (userRoutine: TerminalSearchCallBackProcPtr): TerminalSearchCallBackUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewTerminalClikLoopProc (userRoutine: TerminalClikLoopProcPtr): TerminalClikLoopUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewTerminalEnvironsProc (userRoutine: TerminalEnvironsProcPtr): TerminalEnvironsUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewTerminalChooseIdleProc (userRoutine: TerminalChooseIdleProcPtr): TerminalChooseIdleUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewTerminalToolDefProc (userRoutine: TerminalToolDefProcPtr): TerminalToolDefUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function CallTerminalSendProc (thePtr: Ptr; theSize: LONGINT; refCon: LONGINT; flags: CMFlags; userRoutine: TerminalSendUPP): LONGINT;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
procedure CallTerminalBreakProc (duration: LONGINT; refCon: LONGINT; userRoutine: TerminalBreakUPP);
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function CallTerminalCacheProc (refCon: LONGINT; theTermData: TermDataBlockPtr; userRoutine: TerminalCacheUPP): LONGINT;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
procedure CallTerminalSearchCallBackProc (hTerm: TermHandle; refNum: INTEGER; var foundRect: Rect; userRoutine: TerminalSearchCallBackUPP);
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function CallTerminalClikLoopProc (refCon: LONGINT; userRoutine: TerminalClikLoopUPP): BOOLEAN;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function CallTerminalEnvironsProc (refCon: LONGINT; var theEnvirons: TermEnvironRec; userRoutine: TerminalEnvironsUPP): CMErr;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
procedure CallTerminalChooseIdleProc (userRoutine: TerminalChooseIdleUPP);
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function CallTerminalToolDefProc (hTerm: TermHandle; msg: INTEGER; p1: LONGINT; p2: LONGINT; p3: LONGINT; userRoutine: TerminalToolDefUPP): LONGINT;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function InitTM: TMErr;
function TMGetVersion (hTerm: TermHandle): Handle;
function TMGetTMVersion: INTEGER;
function TMNew ({CONST}
var termRect: Rect; {CONST}
var viewRect: Rect; flags: TMFlags; procID: INTEGER; owner: WindowPtr; sendProc: TerminalSendUPP; cacheProc: TerminalCacheUPP; breakProc: TerminalBreakUPP; clikLoop: TerminalClikLoopUPP; environsProc: TerminalEnvironsUPP; refCon: LONGINT; userData: LONGINT): TermHandle;
procedure TMDispose (hTerm: TermHandle);
procedure TMKey (hTerm: TermHandle; {CONST}
var theEvent: EventRecord);
procedure TMUpdate (hTerm: TermHandle; visRgn: RgnHandle);
procedure TMPaint (hTerm: TermHandle; {CONST}
var theTermData: TermDataBlock; {CONST}
var theRect: Rect);
procedure TMActivate (hTerm: TermHandle; activate: BOOLEAN);
procedure TMResume (hTerm: TermHandle; resume: BOOLEAN);
procedure TMClick (hTerm: TermHandle; {CONST}
var theEvent: EventRecord);
procedure TMIdle (hTerm: TermHandle);
function TMStream (hTerm: TermHandle; theBuffer: univ Ptr; theLength: LONGINT; flags: CMFlags): LONGINT;
function TMMenu (hTerm: TermHandle; menuID: INTEGER; item: INTEGER): BOOLEAN;
procedure TMReset (hTerm: TermHandle);
procedure TMClear (hTerm: TermHandle);
procedure TMResize (hTerm: TermHandle; {CONST}
var newViewRect: Rect);
function TMGetSelect (hTerm: TermHandle; theData: Handle; var theType: ResType): LONGINT;
procedure TMGetLine (hTerm: TermHandle; lineNo: INTEGER; var theTermData: TermDataBlock);
procedure TMSetSelection (hTerm: TermHandle; {CONST}
var theSelection: TMSelection; selType: TMSelTypes);
procedure TMScroll (hTerm: TermHandle; dh: INTEGER; dv: INTEGER);
function TMValidate (hTerm: TermHandle): BOOLEAN;
procedure TMDefault (var theConfig: Ptr; procID: INTEGER; allocate: BOOLEAN);
function TMSetupPreflight (procID: INTEGER; var magicCookie: LONGINT): Handle;
procedure TMSetupSetup (procID: INTEGER; theConfig: univ Ptr; count: INTEGER; theDialog: DialogPtr; var magicCookie: LONGINT);
function TMSetupFilter (procID: INTEGER; theConfig: univ Ptr; count: INTEGER; theDialog: DialogPtr; var theEvent: EventRecord; var theItem: INTEGER; var magicCookie: LONGINT): BOOLEAN;
procedure TMSetupItem (procID: INTEGER; theConfig: univ Ptr; count: INTEGER; theDialog: DialogPtr; var theItem: INTEGER; var magicCookie: LONGINT);
procedure TMSetupXCleanup (procID: INTEGER; theConfig: univ Ptr; count: INTEGER; theDialog: DialogPtr; OKed: BOOLEAN; var magicCookie: LONGINT);
procedure TMSetupPostflight (procID: INTEGER);
function TMGetConfig (hTerm: TermHandle): Ptr;
function TMSetConfig (hTerm: TermHandle; thePtr: univ Ptr): INTEGER;
function TMIntlToEnglish (hTerm: TermHandle; inputPtr: univ Ptr; var outputPtr: Ptr; language: INTEGER): OSErr;
function TMEnglishToIntl (hTerm: TermHandle; inputPtr: univ Ptr; var outputPtr: Ptr; language: INTEGER): OSErr;
procedure TMGetToolName (id: INTEGER; var name: Str255);
function TMGetProcID (name: ConstStr255Param): INTEGER;
procedure TMSetRefCon (hTerm: TermHandle; refCon: LONGINT);
function TMGetRefCon (hTerm: TermHandle): LONGINT;
procedure TMSetUserData (hTerm: TermHandle; userData: LONGINT);
function TMGetUserData (hTerm: TermHandle): LONGINT;
function TMAddSearch (hTerm: TermHandle; theString: ConstStr255Param; {CONST}
var where: Rect; searchType: TMSearchTypes; callBack: TerminalSearchCallBackUPP): INTEGER;
procedure TMRemoveSearch (hTerm: TermHandle; refnum: INTEGER);
procedure TMClearSearch (hTerm: TermHandle);
function TMGetCursor (hTerm: TermHandle; cursType: TMCursorTypes): Point;
function TMGetTermEnvirons (hTerm: TermHandle; var theEnvirons: TermEnvironRec): TMErr;
function TMChoose (var hTerm: TermHandle; where: Point; idleProc: TerminalChooseIdleUPP): INTEGER;
procedure TMEvent (hTerm: TermHandle; {CONST}
var theEvent: EventRecord);
function TMDoTermKey (hTerm: TermHandle; theKey: ConstStr255Param): BOOLEAN;
function TMCountTermKeys (hTerm: TermHandle): INTEGER;
procedure TMGetIndTermKey (hTerm: TermHandle; id: INTEGER; var theKey: Str255);
procedure TMGetErrorString (hTerm: TermHandle; id: INTEGER; var errMsg: Str255);
{ $ALIGN RESET}
{ $POP}
{$ENDC}
{__TERMINALS__}
implementation
end.